package com.kongshidian.util;

import java.util.Comparator;

import com.kongshidian.bean.MySearchHistory;
import com.kongshidian.bean.ProductDetails;

/**
 *  排序
 * @author fbl
 */
@SuppressWarnings("rawtypes")
public class ComparatorByID implements Comparator{

	@Override
	public int compare(Object paramT1, Object paramT2) {
		MySearchHistory m1 = (MySearchHistory) 	paramT1;
		MySearchHistory m2 = (MySearchHistory) 	paramT2;
		int flag = m2.getId() - m1.getId();
		
		return flag;
	}

	public static  class ComparatorByID1 implements Comparator{
		
		@Override
		public int compare(Object paramT1, Object paramT2) {
			ProductDetails m3 = (ProductDetails) 	paramT1;
			ProductDetails m4 = (ProductDetails) 	paramT2;
			int flag = m4.getCid() - m3.getCid();
			
			return flag;
		}
		
	}
}

